import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_demo/getx/controller_binding.dart';
import 'package:flutter_demo/getx/getx_obs_page.dart';
import 'package:flutter_demo/pages/login_page.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      title: 'Getx Obs',
      theme: ThemeData(
        useMaterial3: false, // 禁用Material3样式
        primarySwatch: Colors.blue,
      ),
      home: const GetxObsPage(),
      defaultTransition: Transition.rightToLeft,
      getPages: [
        GetPage(name: '/login', page: () => const LoginPage()),
      ],
      initialBinding: ControllerBinding(), // 全局绑定controller创建
    );
  }
}
